package com.sardine.base.hbase.persister;

import java.io.Serializable;

/**
 * 上海京东到家元信信息技术有限公司<br>
 * Created with IntelliJ IDEA.
 * Date:2017/11/21
 * Time:20:57
 * 数据冷凝管
 * @author daifeng<br>
 *         daifeng@imdada.cn
 * @since JDK 1.7 <br>
 * Copyright (c) 2017 imdada System Incorporated All Rights Reserved.
 */
public interface HEntityAdhesive {
    /**
     * 将数据对象转换成hbase数据模型
     * @param skeleton
     * @param obj
     * @return
     */
    HEntity getPerSister(HEntitySkeleton skeleton, Object obj);
    /**
     * 讲base entity 转换成数据对象
     * @param skeleton
     * @param hEntity
     * @param <T>
     * @return
     */
    <T> T decoderModel(HEntitySkeleton<T> skeleton, HEntity hEntity);

    /**
     * 构建rowkey
     * @param rowKey
     * @param skeleton
     * @return
     */
    HEntity getPerRowKey(Serializable rowKey, HEntitySkeleton skeleton);
}
